# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : zsj.py
# @Time     : 2024/4/11 22:10
# @Author   : Robot-Zsj
"""
description:

input
40 40 18
output
1484
"""
import sys

sys.setrecursionlimit(5000)

m, n, k = map(int, input().split())

ans = 0
visited = set()
offsets = ((-1, 0), (0, -1), (1, 0), (0, 1))

digitSums = [0] * (max(m, n))
for i in range(len(digitSums)):
    num = i
    while num > 0:
        digitSums[i] += num % 10
        num //= 10


def dfs(x, y):
    if x < 0 or x >= m or y < 0 or y >= n:
        return

    if digitSums[x] + digitSums[y] > k:
        return

    pos = x * n + y # 二维坐标 转为 一维索引

    if pos in visited:
        return

    visited.add(pos)

    global ans
    ans += 1

    for X, Y in offsets:
        newX = x + X
        newY = y + Y
        dfs(newX, newY)


dfs(0, 0)
print(ans)
